// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [Aml](super::stub::Aml) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct Aml<T>
where
    T: super::stub::Aml + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> Aml<T>
where
    T: super::stub::Aml + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::Aml for Aml<T>
where
    T: super::stub::Aml + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_instances(
        &self,
        req: crate::model::ListInstancesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListInstancesResponse>> {
        self.inner.list_instances(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_instance(
        &self,
        req: crate::model::GetInstanceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Instance>> {
        self.inner.get_instance(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_instance(
        &self,
        req: crate::model::CreateInstanceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_instance(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_instance(
        &self,
        req: crate::model::UpdateInstanceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_instance(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_instance(
        &self,
        req: crate::model::DeleteInstanceRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_instance(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn import_registered_parties(
        &self,
        req: crate::model::ImportRegisteredPartiesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.import_registered_parties(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn export_registered_parties(
        &self,
        req: crate::model::ExportRegisteredPartiesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.export_registered_parties(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_datasets(
        &self,
        req: crate::model::ListDatasetsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListDatasetsResponse>> {
        self.inner.list_datasets(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_dataset(
        &self,
        req: crate::model::GetDatasetRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Dataset>> {
        self.inner.get_dataset(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_dataset(
        &self,
        req: crate::model::CreateDatasetRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_dataset(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_dataset(
        &self,
        req: crate::model::UpdateDatasetRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_dataset(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_dataset(
        &self,
        req: crate::model::DeleteDatasetRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_dataset(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_models(
        &self,
        req: crate::model::ListModelsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListModelsResponse>> {
        self.inner.list_models(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_model(
        &self,
        req: crate::model::GetModelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::Model>> {
        self.inner.get_model(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_model(
        &self,
        req: crate::model::CreateModelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_model(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_model(
        &self,
        req: crate::model::UpdateModelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_model(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn export_model_metadata(
        &self,
        req: crate::model::ExportModelMetadataRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.export_model_metadata(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_model(
        &self,
        req: crate::model::DeleteModelRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_model(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_engine_configs(
        &self,
        req: crate::model::ListEngineConfigsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListEngineConfigsResponse>> {
        self.inner.list_engine_configs(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_engine_config(
        &self,
        req: crate::model::GetEngineConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::EngineConfig>> {
        self.inner.get_engine_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_engine_config(
        &self,
        req: crate::model::CreateEngineConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_engine_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_engine_config(
        &self,
        req: crate::model::UpdateEngineConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_engine_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn export_engine_config_metadata(
        &self,
        req: crate::model::ExportEngineConfigMetadataRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.export_engine_config_metadata(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_engine_config(
        &self,
        req: crate::model::DeleteEngineConfigRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_engine_config(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_engine_version(
        &self,
        req: crate::model::GetEngineVersionRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::EngineVersion>> {
        self.inner.get_engine_version(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_engine_versions(
        &self,
        req: crate::model::ListEngineVersionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListEngineVersionsResponse>> {
        self.inner.list_engine_versions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_prediction_results(
        &self,
        req: crate::model::ListPredictionResultsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListPredictionResultsResponse>> {
        self.inner.list_prediction_results(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_prediction_result(
        &self,
        req: crate::model::GetPredictionResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::PredictionResult>> {
        self.inner.get_prediction_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_prediction_result(
        &self,
        req: crate::model::CreatePredictionResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_prediction_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_prediction_result(
        &self,
        req: crate::model::UpdatePredictionResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_prediction_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn export_prediction_result_metadata(
        &self,
        req: crate::model::ExportPredictionResultMetadataRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .export_prediction_result_metadata(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn delete_prediction_result(
        &self,
        req: crate::model::DeletePredictionResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_prediction_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_backtest_results(
        &self,
        req: crate::model::ListBacktestResultsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListBacktestResultsResponse>> {
        self.inner.list_backtest_results(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_backtest_result(
        &self,
        req: crate::model::GetBacktestResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::BacktestResult>> {
        self.inner.get_backtest_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_backtest_result(
        &self,
        req: crate::model::CreateBacktestResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_backtest_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_backtest_result(
        &self,
        req: crate::model::UpdateBacktestResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_backtest_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn export_backtest_result_metadata(
        &self,
        req: crate::model::ExportBacktestResultMetadataRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner
            .export_backtest_result_metadata(req, options)
            .await
    }

    #[tracing::instrument(ret)]
    async fn delete_backtest_result(
        &self,
        req: crate::model::DeleteBacktestResultRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_backtest_result(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}
